// 导入vue
import Vue from 'vue'
// 避免移动端浏览器点击延迟
// （默认在点击和click事件触发之间，有300ms的延迟，faskclick可以避免）
import FastClick from 'fastclick'

// 路由
import VueRouter from 'vue-router'

// 自定义组件
import App from './App'

import Wechat from './components/Wechat'
import Message from './components/Message'
import Explore from './components/Explore'
import News from './components/News'
import Second from './components/Second'

import store from './store/index.js'


//说明使用 VueRouter 插件
Vue.use(VueRouter)

//路由配置
const routes = [
  {path:'/wechat',component:Wechat},
  {path:'/explore',component:Explore},
  {path:'/message',component:Message},
  {path:'/news',component:News},
  {path:'/news/second',component:Second}
]

// 新建路由实例
const router = new VueRouter({
  routes
})

// 程序跑起来的初始路由设置
router.push('/wechat')

// 快速点击作用范围
FastClick.attach(document.body)

 // vue 根组件实例
new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')
